 
package net.jforum.view.forum;

import net.jforum.Command;
import net.jforum.JForumExecutionContext;
import net.jforum.SessionFacade;
import net.jforum.util.Captcha;

/**
 * @author Rafael Steil
 * @version $Id: CaptchaAction.java,v 1.9 2007/09/27 04:47:19 rafaelsteil Exp $
 */
public class CaptchaAction extends Command
{
	public void generate()
	{
		SessionFacade.getUserSession().createNewCaptcha();
		
		JForumExecutionContext.enableCustomContent(true);
		JForumExecutionContext.setContentType("image/jpg");
		
		Captcha.getInstance().writeCaptchaImage();
	}
	
	/**
	 * @see net.jforum.Command#list()
	 */
	public void list() 
	{
		this.generate();
	}
}
